$(function() {
	$(".stereotype a").click(function() {
		$(".stereotype a").removeClass("on");
		$(this).addClass("on");
	});
});
$(function() {
	$(".sleevetype a").click(function() {
		$(".sleevetype a").removeClass("on");
		$(this).addClass("on");
	});
});
$(function() {
	$(".recom a").click(function() {
		$(".recom a").removeClass("on");
		$(this).addClass("on");
	});
});
$(function() {
	$(".collar a").click(function() {
		$(".collar a").removeClass("on");
		$(this).addClass("on");
	});
});
$(function() {
	$(".shop_nav1 a").click(function() {
		$(".shop_nav1 a").removeClass("on");
		$(this).addClass("on");
	});
});
$(function() {
	$(".shop_nav2 i").click(function() {
		$(".shop_nav2 i").removeClass("on");
		$(this).addClass("on");
	});
});

window.onload = function() {
	var use = document.getElementById("use");
	var core=document.getElementById("core");
	
	use.onmousemove=function(){
		core.style.display="block";
	}
	core.onmousemove=function(){
		core.style.display="block";
	}
	use.onmouseout=function(){
		core.style.display="none";
	}
	core.onmouseout=function(){
		core.style.display="none";
	}
	
	var r = document.getElementById("retract");
	var s = document.getElementById("shop");
	var dis = document.getElementById("dis");
	var sp = document.getElementById("spread");
	var more = document.getElementById("more");
	var pic = document.getElementById("pic");

	r.onclick = function() {
		if(s.style.display == "block") {
			s.style.display = "none";
			r.style.background = "URL(img/m-1.png) no-repeat 70px center";
			r.innerHTML = "打开筛选";
		} else {
			s.style.display = "block";
			r.innerHTML = "收起筛选";
			r.style.background = "URL(img/m1.png) no-repeat 70px center";
		}
	}

	sp.onclick = function() {
		if(dis.style.display == "table") {
			dis.style.display = "none";

		} else {
			dis.style.display = "table";

		}
	}

	more.onclick = function() {
		if(pic.style.height == "117px") {
			pic.style.height = "234px";
			more.innerHTML = "收起";
			more.style.background = "URL(img/m-2.png) no-repeat 35px 4px";
		} else {
			more.innerHTML = "更多";
			pic.style.height = "117px";
			more.style.background = "URL(img/m2.png) no-repeat 35px 4px";

		}
	}

	var multi = document.getElementById("multi");
	var hf = pic.getElementsByTagName("a");
	var bool = true;

	multi.onclick = function() {
		if(multi.innerHTML == "单选&nbsp;+") {
			multi.innerHTML = "多选&nbsp;+";
			for(var n = 0; n < hf.length; n++) {
				hf[n].style.borderColor = "white";
			}
			bool = true;
		} else {
			multi.innerHTML = "单选&nbsp;+";
			bool = false;
		}
	}

	for(var i = 0; i < hf.length; i++) {
		hf[i].onclick = function() {
			if(bool) {
				for(var s = 0; s < hf.length; s++) {
					hf[s].style.borderColor = "white";//选择单个时
				}
			}
			if (this.style.borderColor == "red") {
				this.style.borderColor = "white";
			} else{
				this.style.borderColor = "red";//选择多个时
			}
		}
	}

}